package com.hxzy.system.service.impl;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hxzy.system.domain.SysNotice;
import com.hxzy.system.domain.dto.SysNoticeSearchDTO;
import com.hxzy.system.mapper.SysNoticeMapper;
import com.hxzy.system.service.ISysNoticeService;
import org.springframework.stereotype.Service;

@Service
public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper,SysNotice> implements ISysNoticeService {


    @Override
    public IPage<SysNotice> search(SysNoticeSearchDTO sysNoticeSearchDTO) {
        Page<SysNotice> page = PageDTO.of(sysNoticeSearchDTO.getPageNum(), sysNoticeSearchDTO.getPageSize());
        return this.baseMapper.search(page,sysNoticeSearchDTO);
    }

    @Override
    public SysNotice searchById(Long noticeId) {
        SysNotice sysNotice = this.baseMapper.selectById(noticeId);
        return sysNotice;
    }
}
